﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using Microsoft.ReportingServices;
using Microsoft.Reporting.WebForms;

namespace MvcReportViewer.Reports
{
    public partial class Report : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            ReportViewer1.ProcessingMode = ProcessingMode.Local;

            ReportViewer1.LocalReport.ReportPath = Server.MapPath("Employees.rdlc");

            DataSet dataSet = new DataSet();
            dataSet.ReadXml(MapPath("Employee.xml"));

            ReportDataSource dataSource = new ReportDataSource("EmployeeDataSet_Employee", dataSet.Tables[0]);

            ReportViewer1.LocalReport.DataSources.Add(dataSource);

        }
    }
}
